<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<title>中科慧联云平台</title>
		<meta name="renderer" content="webkit" />  
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<!-- load css -->
		<link rel="stylesheet" type="text/css" href="layui/css/layui.css" media="all">
		<link rel="stylesheet" type="text/css" href="css/global.css" media="all">
		<link rel="stylesheet" type="text/css" href="css/adminstyle.css" media="all">
		<link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_g7p8q47s1gjk0529.css"/>
	</head>

	<body>
		<div class="layui-layout layui-layout-admin" id="layui_layout">
			<!-- 顶部区域 -->
			<div class="layui-header header header-demo">
				<div class="layui-main">
					<!-- logo区域 -->
					<div class="admin-logo-box">
						<a href="http://www.ic-iot.com"  target="_blank"><img src="img/logo.png" alt=""></a>
					</div>
					<!-- 右侧导航 -->

					<ul class="layui-nav larry-header-item">
						<li class="layui-nav-item">
							<a href="javascript:;"id="message_href" style="background:none; height: 66px; line-height: 66px;"  data-url="message.html">
								<i class="iconfont icon-lingdang" style="font-size: 20px; color: #999;"></i>
								<span style="color:red;" id="unreadNum"></span>
							</a>
						</li>
						<li class="layui-nav-item first">
							<a href="javascript:;" style=" height: 66px; line-height: 66px;" >
								<i class="iconfont icon-yonghuguanli1" style="font-size: 20px;"></i>  
								<span class="layui-nav-more" style="font-size: 26px;"></span>
							</a>
							<dl href="javascript:;" class="layui-nav-child">
								<dd>
									<a href="javascript:;"  data-url="personInfo.html"><label>用户信息</label></a>
								</dd>
								<dd>
									<a href="javascript:;" data-url="changepwd.html"><label>修改密码</label></a>
								</dd>
							</dl>
						</li>
						<li class="layui-nav-item">
							<a href="login.html" id="over" style="background:none; height: 66px; line-height: 66px;" ><i class="iconfont icon-tuichu" style="font-size: 24px;"></i></a>
						</li>
					</ul>
				</div>
			</div>
			<!-- 左侧侧边导航开始 -->
			<div class="layui-side layui-side-bg layui-larry-side">
					<!-- 左侧菜单 -->
					<ul class="layui-nav layui-nav-tree" id="sideNav" lay-filter="sideNav">
						<!--后台首页-->
						<li class="layui-nav-item layui-this" id="home1">
							<a href="javascript:;">
								<i class="iconfont icon-home1" data-icon='icon-home1'></i>
								<label>后台首页</label>
							</a>
						</li>
						<!-- 用户管理 -->
						<li class="layui-nav-item">
							<a href="javascript:;" id="item"> 
								<i class="iconfont icon-iot"></i>
								<label>设备中心</label>
								<em class="layui-nav-more"></em>
							</a>
							<dl class="layui-nav-child">
								<dd>
									<a href="javascript:;" data-url="monitorings.html" id="monitoring">
										<i class="iconfont icon-jiankong"></i>
										<label>设备监控</label>
									</a>
								</dd>
								<dd>
									<a href="javascript:;" data-url="device_list.html" id="index_she" style="display: none;">
										<i class="iconfont icon-shebeiguanli"></i>
										<label>设备管理</label>
									</a>
								</dd>
								<dd>
									<a href="javascript:;" data-url="EquipmentDistribution.html">
										<i class="iconfont icon-cheliangjiankong"></i>
										<label>设备分布</label>
									</a>
								</dd>
								<dd>
									<a href="javascript:;" data-url="inspection.html">
										<i class="iconfont icon-zhijianfuwu"></i>
										<label>年检记录</label>
									</a>
								</dd>
								
							</dl>
						</li>
						<!-- 个人信息 -->
						<li class="layui-nav-item" id="index_yong" style="display: none;">
							<a href="javascript:;">
								<i class="iconfont icon-yonghuguanli1"></i>
								<label>用户管理</label>
								<em class="layui-nav-more"></em>
							</a>
							<dl class="layui-nav-child">
								<dd>
									<a href="javascript:;" data-url="user_list.html">
										<i class="iconfont icon-round_users_fill"></i>
										<label>用户列表</label>
									</a>
								</dd>
							</dl>
						</li>
						<li class="layui-nav-item" id="inde_che" style="display: none;">
							<a href="javascript:;">
								<i class="iconfont icon-cheliangguanli"></i>
								<label>车辆管理</label>
								<em class="layui-nav-more"></em>
							</a>
							<dl class="layui-nav-child">
								<dd>
									<a href="javascript:;" data-url="distribution.html">
										<i class="iconfont icon-cheliangjiankong"></i>
										<label>车辆监控</label>
									</a>
								</dd>
							</dl>
						</li>
						<!-- 企业管理 -->
						<li class="layui-nav-item" id="index_enterprise" style="display: none;">
							<a href="javascript:;">
								<i class="iconfont icon-qiyeguanli"></i>
								<label>企业管理</label>
								<em class="layui-nav-more"></em>
							</a>
							<dl class="layui-nav-child">
								<dd>
									<a href="javascript:;" data-url="enterprise_list.html">
										<i class="iconfont icon-qiye" data-icon='icon-qiye'></i>
										<label>企业列表</label>
									</a>
								</dd>
							</dl>
						</li>
						<!-- 公告管理 -->
						<li class="layui-nav-item" id="index_notice" style="display: none;">
							<a href="javascript:;">
								<i class="iconfont icon-qiyeguanli"></i>
								<label>公告管理</label>
								<em class="layui-nav-more"></em>
							</a>
							<dl class="layui-nav-child">
								<dd>
									<a href="javascript:;" data-url="notice_list.html">
										<i class="iconfont icon-qiye" data-icon='icon-qiye'></i>
										<label>公告列表</label>
									</a>
								</dd>
							</dl>
						</li>
						<!-- 技术支持 -->
						<li class="layui-nav-item">
							<a href="javascript:;">
								<i class="iconfont icon-guanyu"></i>
								<label>关于平台</label>
								<em class="layui-nav-more"></em>
							</a>
							<dl class="layui-nav-child">
								<dd>
									<a href="javascript:;" data-url="TechnicalSupport.html">
										<i class="iconfont icon-iconfontfuwu"></i>
										<label>技术支持</label>
									</a>
								</dd>
							</dl>
						</li>
					</ul>
			</div>
			<!-- 右侧主体内容 -->
			<div class="layui-body" style="bottom: 0;">
				<div class="layui-tab fly-tab layui-tab-card" lay-filter="page-tab" >
					<ul class="layui-tab-title" id="tabTitle">
						<li class="layui-this" lay-id="0" id="lay0" ><i class="iconfont icon-home1" data-icon='icon-home1'></i><label >后台首页</label></li>
					</ul>
					<div class="layui-tab-content" id="tabContainers">
						<div class="layui-tab-item layui-show">
							<iframe class="larry-iframe" data-id='0' name="main" src="main.html"></iframe>
						</div>
					</div>
				</div>
			</div>
			<!-- 底部区域 -->
			<div class="layui-footer layui-larry-foot" id="larry-footer">
				<div class="layui-mian">
					<div class="larry-footer-left">
						Copyright © 2014-2017 中科慧联. All rights reserved.
					</div>
				</div>
			</div>
		</div>
		<!-- 加载js文件-->
		<script type="text/javascript" src="layui/layui.js"></script>
		<script type="text/javascript" src="js/index.js"></script>
		<script type="text/javascript" src="js/common.js"></script>
		<script src="http://cdn.bootcss.com/sockjs-client/1.1.1/sockjs.min.js"></script>
		<script src="http://cdn.bootcss.com/stomp.js/2.3.3/stomp.js"></script>
		<script src="http://cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
		<script type="text/javascript">
			

			
			$("#lay0").on('click',function(){
				$("#home1").click();
			});
			
			
			$("#home1").on('click', function() {
				parent.document.getElementById("lay0").click();
	
			});
			
			$(document).ready(function () {
				connectAny();
			});

			var stompClient = null;

			//this line.


			function getInitNum() {
				stompClient.send("/app/message", {}, adminId);
			}
			function connectAny() {
				var socket = new SockJS(url+"/ic-iot/hello");
				stompClient = Stomp.over(socket);
				stompClient.connect({}, function (frame) {
					//console.log('Connected: ' + frame);
					stompClient.subscribe('/user/'+adminId+'/message', function (response) {
						//alert(JSON.parse(greeting.body).content);
						showNotifyNum(response);
					});
					getInitNum();
				});
			}

			function showNotifyNum(response) {
				var notify=JSON.parse(response.body);
				var unReadNum=notify.initNum;
				if(unReadNum)
					$('#unreadNum').text(unReadNum);
				else
					$('#unreadNum').text("");
			}
		</script>
	</body>

</html>